
const db=require('./db.js')


let querySql=(sql)=>{
 let p1= new Promise((resolve,reject)=>{
      db.query(sql,  (error, results, fields)=> {
          if (error)  reject(error)
         
             resolve(results)
        });
        db.end();  // 关闭连接
      

    })

    return p1


}


module.exports=querySql